 <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>买8商城</title>
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
</head>
<script>
     /*让文字和标签的大小随着屏幕的尺寸做变话 等比缩放*/
     var html = document.getElementsByTagName('html')[0];
        console.log(html);
        /*取到屏幕的宽度*/
        var width = window.innerWidth;
        console.log(width);
        /* 640 100  320 50 */
        var fontSize = 100/750*width;
        console.log(fontSize);
        /*设置fontsize*/

        html.style.fontSize = fontSize +'px';
        window.onresize = function(){
            var html = document.getElementsByTagName('html')[0];
            console.log(html);
            /*取到屏幕的宽度*/
            var width = window.innerWidth;
            console.log(width);
            /* 640 100  320 50 */
            var fontSize = 100/640 * width;
            console.log(fontSize);
            /*设置fontsize*/
            html.style.fontSize = fontSize +'px';

        }
</script>
<body>
    <div id="app">
    </div>    
<script type="text/javascript" src="build.js"></script></body>
</html>